<template>
    <div>
        <!-- 面包屑 -->
        <el-bread></el-bread>
        <!-- 添加按钮 -->
        <el-button @click="add" type="primary" plain>添加</el-button>
        <!-- 列表 -->
        <list @edit="edit"></list>
        <!-- 弹窗 -->
        <dia-log ref="dialogRef" :isShow="isShow" :isAdd="isAdd" @cancel="cancel"></dia-log>
    </div>
</template>
<script>
import list from './list.vue';
import diaLog from './dialog.vue';
export default {
    data() {
        return {
            isAdd:true,//是否添加
            isShow:false,//弹窗状态值
        }
    },
    methods: {
        // 点击添加按钮  弹出弹窗
        add(){
            this.isShow = true;
            this.isAdd = true;
        },
        // 关闭弹窗
        cancel(){
            this.isShow = false;
        },
        // 编辑
        edit(id){
            this.isShow = true;
            this.isAdd = false;
            this.$refs.dialogRef.lookup(id)
        }
    },
    mounted() { },
    watch: {},
    computed: {},
    filters: {},
    components: {
        list,diaLog
    },
}
</script>
<style scoped>
.el-button{
    margin: 20px 0 10px;
}
</style>